package com.example.finalproject.collection;

import com.example.finalproject.User.User;
import com.example.finalproject.car.Car;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CollectionRepository {
    //添加汽车id到收藏表
    @Insert("insert into collection(carId) values(#{carId})")
    public void insertCollection(String carId);
    //查询表里的所有汽车
    @Select("select * from collection")
    public List<Collection> findAllCollection();
    //删除收藏的汽车
    @Delete("delete from collection where carId=#{carId}")
    public void deleteCarById(String CarId);
}
